#ifndef _FSTREE_INCLUDED_
#define _FSTREE_INCLUDED_

#include "qt-proxy.hh"

struct Device;
class FS;
class FSTree : public QAbstractItemModel
{
	Q_OBJECT

	FS* fs;
	mutable QVector<QString> pathList;
	QSet<QString> activePaths;

public:
	FSTree(FS *argFS);
	int columnCount(const QModelIndex&) const;
	int rowCount(const QModelIndex &parent = QModelIndex()) const;
	QModelIndex index(int, int, const QModelIndex& index = QModelIndex()) const;
	QModelIndex parent(const QModelIndex&) const;
	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
	QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
	QString filePath(const QModelIndex& index) const;
	Qt::ItemFlags flags ( const QModelIndex & ) const
	{ return Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled; }
	QList<QString> getSelected() const;

public slots:
	void toggleItem( const QModelIndex & index );


private:
	QStringList entryList(QString &path) const;
};

#endif //_FSTREE_INCLUDED_
